/**
 * Project Name:Micro-Services-Common
 * File Name   :ClassUtils.java
 * Package Name:com.micro.services.common.utils
 * Date:2015-9-9上午9:37:47
 * Copyright (c) 2015, http://my.oschina.net/httpssl All Rights Reserved.
 *
 */

package com.micro.services.common.utils;

import java.util.List;

import com.micro.services.common.exception.ReflectionException;

/**
 * ClassName:ClassUtils <br/>
 * Function :TODO ADD FUNCTION. <br/>
 * Reason :TODO ADD REASON. <br/>
 * Date :2015-9-9 上午9:37:47 <br/>
 * 
 * @author :http://my.oschina.net/httpssl
 * @email :491835898@QQ.COM
 * @since :JDK 1.7
 * @see
 */
public class ClassUtils<T>
{

	public static <T> T newInstance(final Class<T> clazz) {
		T result;
		try {
			result = clazz.newInstance();
		} catch (final ReflectiveOperationException e) {
			throw new ReflectionException(e.getMessage());
		}
		return result;
	}
	
	public static String getShortClassName(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getShortClassName(clazz);
	}
	
	public static String getPackageName(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getPackageName(clazz);
	}
	
	public static String getPackageCanonicalName(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getPackageCanonicalName(clazz);
	}
	
	public static String getSimpleName(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getSimpleName(clazz);
	}
 
	public static List<Class<?>> getAllInterfaces(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getAllInterfaces(clazz);
	}
	
	public static List<Class<?>> getAllSuperclasses(Class<?> clazz){
		return org.apache.commons.lang3.ClassUtils.getAllSuperclasses(clazz);
	}
	
	 
	 
	
}
